# coding: utf-8
import random

print('random', '-' * 40)
random.seed(10)
print(random.random())
print(random.randint(1, 100))
print(random.randrange(1, 100, 3))

print(random.uniform(1, 100))
print(random.choice(range(10)))
list = [10, 23, 44]
random.shuffle(list)
print(list)

import time

print('time', '-' * 40)
print(time.time())
print(time.localtime())
print(time.ctime())
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()))
print(time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime()))
# print(time.sleep(3))
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()))
print(time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime()))

from datetime import datetime

print('datetime', '-' * 40)
now = datetime.now()
print(now)
print(datetime.date(now))
print(datetime.time(now))

str = '2000-04-12 16:36'
dt1 = datetime.strptime(str, '%Y-%m-%d %H:%M')
# print(datetime.tzinfo())
print(dt1)

from datetime import timedelta

print('timedelta', '-' * 40)
print(timedelta(days=6))

# pip install 模块名 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
# python -m pip install --upgrade pip